﻿#ifndef MCUSTOMPLOT_H
#define MCUSTOMPLOT_H
#include <qcustomplot.h>
class Mcustomplot :public QCustomPlot
{
    Q_OBJECT

public:
    explicit Mcustomplot(QWidget* parent);

    void UpdateSettingCommonXaXisx();

    void initPlot();
    void SlotDataTimeOut();
    void addPlotData(int index,double x,double y);
public slots:
        void SlotItemChange(QString id, bool check);
private:
    void ConnectAllAxisx(bool on);
    QCPAxisRect*  CreateQCPAxisRect(QString channel);
    void RemoveQCPAxisRect(QString channel);
private:
    QMap<int,QCPAxisRect*>  m_channel_axises;
    QMap<int,QCPGraph*>  m_channel_plots;

    int max = 0;
    int min = 0;
};

#endif // MCUSTOMPLOT_H
